local targetKills = 150

ACHIEVEMENT.Name			= "Pistol Master"
ACHIEVEMENT.Description		= "Kill "..targetKills.." enemies using semi-automatic pistols."
ACHIEVEMENT.Icon			= nil

function ACHIEVEMENT:OnNPCKilled (npc, atk, wpn)
	if (!IsValid(atk) or !atk:IsPlayer()) then return end
	
	local weap = atk:GetActiveWeapon()
	if ( !IsValid( weap ) ) then return end
	
	if (weap.Slot != 1) or (weap.Primary.Automatic != false) then return end
	
	printd ("Pistol pass.")
	
	local kills = self:GetValue( atk, "kills", 0 )
	self:SetValue( atk, "kills", kills + 1 )
end

function ACHIEVEMENT:CompletionConditions (ply)
	return self:GetValue( ply, "kills", 0 ) > targetKills
end

function ACHIEVEMENT:FractionComplete (ply)
	return self:GetValue( ply, "kills", 0 ) / targetKills
end

function ACHIEVEMENT:StatusText( ply )
	return math.min( self:GetValue( ply, "kills", 0 ), targetKills ) .. "/" ..targetKills
end
